﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Medianamik.Core.Querying
{
    public enum Comparison
    {
        Equal,
        NotEqual,
        In,
        NotIn,
        Like,
        LessThanOrEqual,
        MoreThanOrEqual,
        LessThan,
        MoreThan
    }

    public static class ComparisonExtensions
    {
        public static string ToSqlOperator(this Comparison c)
        {
            switch (c)
            {
                case Comparison.Equal:
                    return "=";
                case Comparison.NotEqual :
                    return "<>";
                case Comparison.In:
                    return " IN ";
                case Comparison.NotIn:
                    return " NOT IN ";
                case Comparison.Like:
                    return " LIKE ";
                case Comparison.LessThanOrEqual:
                    return "<=";
                case Comparison.MoreThanOrEqual :
                    return ">=";
                case Comparison.LessThan :
                    return "<";
                case Comparison.MoreThan:
                    return ">";
                default:
                    throw new NotSupportedException("Not Supported Comparison");
            }
        }
    }
}
